/*
 * Copyright (c) 2007, TopCoder, Inc. All rights reserved.
 */

using System;
using System.Runtime.Serialization;

namespace TopCoder.Util.Calendar.Entry
{
    /// <summary>
    /// <para>
    /// Represents the exception thrown to indicate any error occurs in the data source layer.
    /// For example: unable to connect to a specific data source.
    /// </para>
    /// <para>
    /// This exception will be directly thrown by the methods in implementations of
    /// <c>ICalendarEntryDataSource</c> interface.
    /// </para>
    /// </summary>
    /// <remarks>
    /// Thread-Safety: This class is immutable and thread safe.
    /// </remarks>
    ///
    /// <author>snower, fuyun</author>
    /// <version>1.0</version>
    /// <copyright>Copyright (c) 2007, TopCoder, Inc. All rights reserved.</copyright>
    [Serializable]
    public class CalendarEntryDataSourceException : ApplicationException
    {
        /// <summary>
        /// Creates a new <c>CalendarEntryDataSourceException</c> instance.
        /// </summary>
        public CalendarEntryDataSourceException()
        {
        }

        /// <summary>
        /// <para>
        /// Creates a new <c>CalendarEntryDataSourceException</c> instance with the given error message.
        /// </para>
        /// </summary>
        /// <param name="message">The detailed error message of this exception.</param>
        public CalendarEntryDataSourceException(string message)
            : base(message)
        {
        }

        /// <summary>
        /// Creates a new <c>CalendarEntryDataSourceException</c> instance with the given error
        /// message and cause.
        /// </summary>
        /// <param name="message">The detailed error message of this exception.</param>
        /// <param name="cause">The inner cause of this exception.</param>
        public CalendarEntryDataSourceException(string message, Exception cause)
            : base(message, cause)
        {
        }

        /// <summary>
        /// Creates a new <c>CalendarEntryDataSourceException</c> instance with serialized data.
        /// </summary>
        /// <param name="info">The object that holds the serialized object data.</param>
        /// <param name="context">The contextual information about the source or destination.</param>
        protected CalendarEntryDataSourceException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }
    }
}